<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, room-scalable=no" />
<title>分页 - 光年(Light Year Admin)后台管理系统模板</title>
<link rel="icon" href="favicon.ico" type="image/ico">
<meta name="keywords" content="LightYear,光年,后台模板,后台管理系统,光年HTML模板">
<meta name="description" content="LightYear是一个基于Bootstrap v3.3.7的后台管理系统的HTML模板。">
<meta name="author" content="yinqi">
<link th:href="@{/css/bootstrap.min.css}" rel="stylesheet">
<link th:href="@{/css/materialdesignicons.min.css}" rel="stylesheet">
<link th:href="@{/css/style.min.css}" rel="stylesheet">
</head>
  
<body>
<div class="lyear-layout-web">
  <div class="lyear-layout-container">
    <!--左侧导航-->
   <div th:insert="left"></div>
    <!--End 左侧导航-->
    
    <!--头部信息-->
    <div th:insert="header"></div>
    <!--End 头部信息-->
    
    <!--页面主要内容-->
    <main class="lyear-layout-content">
      
      <div class="container-fluid">
        
        <div class="row">
          <div class="col-lg-12">
            <div class="card">
              <div class="card-header"><h4>房间信息</h4>

              </div>
              <div class="card-body">
                <!-- 查询功能 -->
                <form action="/room/list" method="get" class="form-inline">
                  <div class="form-group">
                    <input type="text" name="name" class="form-control" placeholder="房间名" th:value="${param.name}">
                  </div>
                  <div class="form-group">
                    <input type="text" name="RoomNumber" class="form-control" placeholder="房间号" th:value="${param.RoomNumberr}">
                  </div>
                  <button type="submit" class="btn btn-primary">查询</button>

                </form>
                <hr>
              <div class="card-body">

                <a href="/room/add" class="btn btn-info">新增房间</a>
                <table class="table table-bordered table-hover">
                  <thead>
                    <tr>
                      <th>序号</th>
                      <th>房间名称</th>
                      <th>房间号码</th>
                      <th>房间类型</th>
                      <th>服务员</th>
                      <th>创建时间</th>
                      <th>操作</th>
                    </tr>
                  </thead>
                  <tbody>
                    <tr th:each="room:${allRooms}">
                      <td th:text="${room.id}">1</td>
                      <th th:text="${room.name}">房间名称</th>
                      <th th:text="${room.RoomNumber}">房间号码</th>
                      <th th:text="${room.type}">房间类型</th>
                      <th th:text="${room.Waiter}">服务员</th>
                      <th th:text="${room.createTime}">创建时间</th>
                      <th><a th:href="'update?id='+${room.id}" class=" btn-xs btn btn-warning">修改</a>
                         <a th:href="'delete?id='+${room.id}" class=" btn-xs btn btn-danger">删除</a>
                      </th>
                    </tr>

                  </tbody>
                </table>
                <nav>
                  <ul class="pagination pagination-lg">
                    <!-- 上一页 -->
                    <li th:class="${pageInfo.current == 1} ? 'disabled'">
                      <a th:href="@{/list(pageNum=${pageInfo.current - 1})}">上一页</a>
                    </li>

                    <!-- 页码 -->
                    <li th:each="i : ${#numbers.sequence(1, pageInfo.pages)}"
                        th:class="${pageInfo.current == i} ? 'active'">
                      <a th:href="@{/list(pageNum=${i})}" th:text="${i}"></a>
                    </li>

                    <!-- 下一页 -->
                    <li th:class="${pageInfo.current == pageInfo.pages} ? 'disabled'">
                      <a th:href="@{/list(pageNum=${pageInfo.current + 1})}">下一页</a>
                    </li>
                  </ul>
                </nav>
                
              </div>
            </div>
          </div>
        </div>
        
      </div>
      </div>
    </main>
    <!--End 页面主要内容-->
  </div>
</div>


<script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/js/bootstrap.min.js}"></script>
<script type="text/javascript" th:src="@{/js/perfect-scrollbar.min.js}"></script>
<script type="text/javascript" th:src="@{/js/main.min.js}"></script>
</body>
</html>